package com.jeesite.modules.kj.api.vo.responseVo;

import com.jeesite.common.config.Global;
import com.jeesite.modules.kj.api.enumCode.UnicomResponseEnums;

public class ResponseBean<T> {
    private String result;
    private T data;
    private String errCode;
    private String message;

    public ResponseBean() {
        super();
        this.result = Global.TRUE;
        this.errCode = UnicomResponseEnums.SUCCESS_OPTION.getCode();
        this.message = UnicomResponseEnums.SUCCESS_OPTION.getMsg();
    }

    public ResponseBean(String result, T data) {
        super();
        this.result = result;
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResponseBean{" +
                "result=" + result +
                ", data=" + data +
                ", errCode='" + errCode + '\'' +
                ", message='" + message + '\'' +
                '}';
    }

    public ResponseBean(String result, T data, String errCode, String message) {
        super();
        this.result = result;
        this.data = data;
        this.errCode = errCode;
        this.message = message;
    }

    public ResponseBean(T data) {
        super();
        this.result = Global.TRUE;
        this.data = data;
        this.errCode = UnicomResponseEnums.SUCCESS_OPTION.getCode();
        this.message = UnicomResponseEnums.SUCCESS_OPTION.getMsg();
    }


    public ResponseBean(String result, String errCode, String message) {
        this.result = result;
        this.errCode = errCode;
        this.message = message;
    }

    public ResponseBean(String result, UnicomResponseEnums enums) {
        this.result = result;
        this.errCode = enums.getCode();
        this.message = enums.getMsg();
    }

    public ResponseBean(String result, T data, UnicomResponseEnums enums) {
        this.result = result;
        this.data = data;
        this.errCode = enums.getCode();
        this.message = enums.getMsg();
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}

